<script lang="ts" setup>
import { Result } from 'ant-design-vue'
import { useGo } from '@/hooks/web/usePage'
import { useTabs } from '@/hooks/web/useTabs'
import { useI18n } from '@/hooks/web/useI18n'

defineProps({
  isUpdate: {
    type: Boolean,
    default: false,
  },
})

const { t } = useI18n()

const go = useGo()
const { closeCurrent } = useTabs()

function handleGoList() {
  closeCurrent()
  go('/wages/salary-slip')
}
</script>

<template>
  <div class="m-5 bg-white px-8 py-12 dark:bg-dark">
    <Result status="success" :title="`工资单${isUpdate ? t('action.edit') : t('action.create')}成功`" sub-title="可点击下方按钮返回列表页。">
      <template #extra>
        <a-button key="console" type="primary" @click="handleGoList">
          返回列表
        </a-button>
      </template>
    </Result>
  </div>
</template>
